package com.turing.data.scripts.contract.transfer

import com.turing.data.vo.out.review.DependParamsVO
import com.turing.data.vo.out.review.TaskElementVO

class IfPerformanceBenchmark_30192_10_transfer {

    static List< TaskElementVO.DrawResultVO > doConvert(List< TaskElementVO.DrawResultVO > resultVOs, DependParamsVO dependParams){

        for (drawResultVO in resultVOs) {
                def childTaskSn = drawResultVO.childTaskSn
                if(null == childTaskSn || childTaskSn == ""){
                    continue
                }
            String modelValue = drawResultVO.text

            String REGEX_NOT_PERFORMANCE_BENCHMARK1 = /.*不.*/
            String REGEX_NOT_PERFORMANCE_BENCHMARK2 = /.*未设置.*/

            String REGEX_PERFORMANCE_BENCHMARK = /.*业绩比较基准.*/

            if (modelValue =~ REGEX_NOT_PERFORMANCE_BENCHMARK1||modelValue =~ REGEX_NOT_PERFORMANCE_BENCHMARK2) {
                drawResultVO.businessValue = "否"
                drawResultVO.type = 1
            }else if (modelValue =~ REGEX_PERFORMANCE_BENCHMARK) {
                drawResultVO.businessValue = "是"
                drawResultVO.type = 1
            } else {
                drawResultVO.businessValue = "否"
                drawResultVO.type = 1
            }

        }

        return resultVOs
    }

}
